After completing this lesson, you’ll be able to:
An essential part of any workflow is handling data that fails to process, for example, when a feature with no geometry is sent into a geometry-based transformer like the AreaBuilder.
FME handles such failures by outputting the data through <Rejected> ports, which are found on many transformers:
A parameter exists to control the action of <Rejected> ports and gives the workspace author a choice over what action to take.
When a feature is rejected, the translation will stop, and a red circle with a number will appear on the <Rejected> port. You can click on the cache to inspect the feature and determine why it was rejected:
The parameter to control the handling of rejected features can be found in the Navigator window under Workspace Parameters:
The two options are Terminate Translation and Continue Translation.
When the parameter is set to Terminate Translation, a feature exiting via a <Rejected> port causes the translation to stop. To visually denote this, the <Rejected> ports have a small black marker:
When the parameter is set to Continue Translation, the translation will continue to run regardless of how many features exit <Rejected> ports. In that case, the small black marker is removed:
In Terminate Translation mode, a rejected feature gets written to the log window with the error message:
The below feature caused the translation to be terminated
There will also be an error message relating to the transformer:
Intersector_<Rejected>(TeeFactory): Intersector_<Rejected>: Termination Message: 'Intersector output a <Rejected> feature.
This error is helpful because it tells the author which transformer experienced the failure.
To quickly find these error messages, you can filter the Translation Log by clicking the Errors button.
There is an important exception to the behavior of Terminate Translation mode: a rejected feature will not cause the translation to stop provided that the <Rejected> port is connected to a further object:
In short, an author can create a mixed mode, where some transformers stop the translation on rejecting a feature (the Intersector above), but others will handle the feature another way (the Bufferer). That way, the author can try to handle rejected expected features but stop the translation if there are genuinely unexpected failures.
Generally:
- Terminate mode is helpful if you do not want any features rejected and want to verify that all your data is correct.
- Continue mode is helpful if you don't care if a feature is rejected. You assume rejections happen because of incorrect data and don't want to use those records.
- Mixed mode is helpful if you want to pick and choose which transformers' <Rejected> ports you care about.
Another important fact is that just because a feature is not rejected, does not mean the results are 100% correct! FME will only reject features based on specific problems. It doesn't know if your workspace is actually doing what you intend; that's up for you to determine.
In continue mode, features that exit a <Rejected> port are counted and saved for inspection:
FME will save features for inspection even if you do not attach a Logger or other transformer. The number tells us how many features were rejected, and the green icon can be clicked to inspect the data.